import request from '@/utils/request'

export function getQuestionsList() {
    return request({
        url: '/web/question/list',
        method: 'get'
    })
}
export function getQuestionsHotList() {
    return request({
        url: '/web/question/hot-list',
        method: 'get'
    })
}


export function getQuestionInfo(questionId) {
    return request({
        url: '/web/question-info',
        method: 'get',
        params: questionId
    })
}

// 还有一种方法  就是先传参数进来

export function getQuestionsComment(questionId) {
    return request({
        url: '/web/question/comment-list',
        method: 'get',
        params: {
            questionId: questionId
        }
    })
}
export function addComment(commentForm) {
    return request({
        url: '/web/comment/publish',
        method: 'post',
        data: commentForm
    })
}